﻿namespace Liger.Web.UI
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Liger.Web.Common;
    using Liger.Web.Common.Extensions;

    public class FormFieldsBuilder : IHideObjectMembers
    {
        private readonly IList<FormField> fields;
        public FormFieldsBuilder(IList<FormField> fields)
        {
            this.fields = fields;
        }

        public virtual FormFieldBuilder Add(string name)
        {
            return Bound(name);
        }

        public virtual FormFieldBuilder Bound(string name)
        {
            FormField column = new FormField();
            column.Name = name;
            this.fields.Add(column);
            return new FormFieldBuilder(column);
        }

    }
}
